package com.ruoyi.lecturer.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lecturer.mapper.LecturerMapper;
import com.ruoyi.lecturer.domain.Lecturer;
import com.ruoyi.lecturer.service.ILecturerService;

/**
 * 讲师信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-10
 */
@Service
public class LecturerServiceImpl implements ILecturerService 
{
    @Autowired
    private LecturerMapper lecturerMapper;

    /**
     * 查询讲师信息
     * 
     * @param id 讲师信息主键
     * @return 讲师信息
     */
    @Override
    public Lecturer selectLecturerById(Long id)
    {
        return lecturerMapper.selectLecturerById(id);
    }

    /**
     * 查询讲师信息列表
     * 
     * @param lecturer 讲师信息
     * @return 讲师信息
     */
    @Override
    public List<Lecturer> selectLecturerList(Lecturer lecturer)
    {
        return lecturerMapper.selectLecturerList(lecturer);
    }

    /**
     * 新增讲师信息
     * 
     * @param lecturer 讲师信息
     * @return 结果
     */
    @Override
    public int insertLecturer(Lecturer lecturer)
    {
        lecturer.setCreateTime(DateUtils.getNowDate());
        return lecturerMapper.insertLecturer(lecturer);
    }

    /**
     * 修改讲师信息
     * 
     * @param lecturer 讲师信息
     * @return 结果
     */
    @Override
    public int updateLecturer(Lecturer lecturer)
    {
        return lecturerMapper.updateLecturer(lecturer);
    }

    /**
     * 批量删除讲师信息
     * 
     * @param ids 需要删除的讲师信息主键
     * @return 结果
     */
    @Override
    public int deleteLecturerByIds(Long[] ids)
    {
        return lecturerMapper.deleteLecturerByIds(ids);
    }

    /**
     * 删除讲师信息信息
     * 
     * @param id 讲师信息主键
     * @return 结果
     */
    @Override
    public int deleteLecturerById(Long id)
    {
        return lecturerMapper.deleteLecturerById(id);
    }
}
